+2007-10-10 Emmanuele Bassi <ebassi@gnome.org>
+
+ * gtk/gtkfilechooserdefault.c (list_mtime_data_func): Convert
+ the format to the current locale before passing it to
+ strtime(). Fixes corrupt dates with non-UTF8 encodings on
+ OpenSolaris. (#465380, Takao Fujiwara)
+
2007-10-10 Emmanuele Bassi <ebassi@gnome.org>
* gtk/gtkfilechooserdefault.c (list_mtime_data_func): Fix the
struct tm tm_mtime;
time_t time_now;
const gchar *format;
+ gchar *locale_format = NULL;
gchar buf[256];
#ifdef HAVE_LOCALTIME_R
format = "%x"; /* Any other date */
}
- if (strftime (buf, sizeof (buf), format, &tm_mtime) != 0)
+ locale_format = g_locale_from_utf8 (format, -1, NULL, NULL, NULL);
+
+ if (strftime (buf, sizeof (buf), locale_format, &tm_mtime) != 0)
date_str = g_locale_to_utf8 (buf, -1, NULL, NULL, NULL);
else
date_str = g_strdup (_("Unknown"));
+
+ g_free (locale_format);
}
g_object_set (cell,